package com.solocredit.finance.utils.room;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface UserEventDao {
    @Insert
    void insert(UserEvent event);

    @Query("SELECT * FROM user_events WHERE isReported = 0 ORDER BY timestamp ASC")
    List<UserEvent> getUnreportedEvents();

    @Update
    void updateEvents(List<UserEvent> events);

    @Query("DELETE FROM user_events WHERE isReported = 1")
    void deleteReportedEvents();
}
